import java.awt.*;
import java.awt.event.MouseEvent;

import javax.swing.*;

public class Activity extends Element {

	public Activity(String text, int x, int y, GridPanel parent) {
		super("", x, y, parent);
        statHeight = 50;
        statWidth = 100;
        maxWidth = 2*statWidth;
		maxHeight=2*statHeight;
		setSize(statWidth, statHeight);
		this.width = statWidth;
		this.height = statHeight;
		maxInputCount=-1;
		maxOutputCount=1;
		
	}

	public void paintComponent(Graphics g) {

		Graphics2D g2d = (Graphics2D) g;
		g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
				RenderingHints.VALUE_ANTIALIAS_ON);
		g2d.setColor(Color.BLACK);
		g2d.drawRoundRect(0, 0, width - 1, height - 1, 30, height - 1);
		g2d.setColor(Color.ORANGE);
		g2d.fillRoundRect(1, 1, width - 2, height - 2, 30, height - 2);
		g2d.setFont(new Font("Verdana", Font.PLAIN, 20));
		g2d.setColor(Color.BLACK);
		g2d.drawString(text, 15, 32);

		if (selected) {
			g2d.setColor(Color.BLACK);
			int[] xP = new int[3];
			int[] yP = new int[3];
			xP[0] = width - 7;
			yP[0] = height;
			xP[1] = width;
			yP[1] = height - 7;
			xP[2] = width;
			yP[2] = height;
			g2d.fillPolygon(xP, yP, 3);
		}
	}

}
